<style lang="less">
    @import "./style/index.less";
</style>
<template>
    <div class="page index">
        <div class="hd">
            <h1 class="page_title">闯关答题 横扫任务</h1>
            <p class="page_desc">赢奖券，刮现金 金币 流量包</p>
            <p class="page_desc">一个都不能少！100%中奖</p>
        </div>
        <div class="bd">
            <div class="index_icon"><img v-bind:src="index_img"></div>
            <a class="weui_btn weui_btn_warn start_btn" v-link="{path:'recommend'}">开始今日任务</a>
            <p class="page_desc">今日还剩奖券{{tick_num}}张</p>
        </div>
        <div class="tips" v-show="tip">
            <div class="cover"></div>
            <i class="cancel" @click="hideTips"></i>
            <div class="info">
                <p class="title">要关注“游戏钱吧”才能参加任务活动哦~</p>
                <p class="des">1. 在微信右上角“+”里点击“<span>添加朋友</span>”</p>
                <p class="des">搜索微信号：</p>
                <p class="des"><span class="input">youxi78app</span></p>
                <p class="des">2. 点击详细资料底部的</p>
                <p class="des"><a class="weui_btn weui_btn_primary" href="#recommend">关注</a></p>
                <p class="des">关注我们！</p>
            </div>
        </div>
        <msg :data="errorData"></msg>
    </div>
</template>

<script type="text/ecmascript-6">
import {weixinUrl} from '../lib/args'
import server from '../lib/server'
import index_img from '../images/index_icon.png'
import Msg from '../components/Msg.vue'
export default {
  components:{
    Msg
  },
  data () {
    return {
        weixinUrl,
        tip:false,
        index_img,
        tick_num:0,
        errorData:{},
    }
  },
  methods:{
    hideTips(){
        this.tip=false;
    }
  },
  created () {
    server('/P/public/getticketNum').success((response)=>{
        if(response.code==1){
            this.tick_num=response.data;
        }else{
            this.errorData={
                show:true,
                type:'error',
                msg:response.msg
            };
        }
    });
  },

  destroyed () {
  }
}
</script>
